package cn.redragon.soa.data.entity;

import cn.redragon.soa.common.enums.StockActionType;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.SuperBuilder;

@Entity
@Table(name = "stock_history")
@Getter
@Setter
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class StockHistoryEntity extends BaseEntity {

    private String sku;

    private String spu;

    private String type;

    private Long available;

    private Long reserved;

    private Long requested;

    private Long imported;

    private String orderNumber;

    private String customerId;

    @Enumerated(EnumType.STRING)
    private StockActionType action;

    @Builder.Default
    private Boolean isSuccess = false;

    private String traceId;

    private String remarks;
}
